import instance from "@/assets/http"

// 加入购物车
export const addCart = (userid: string, proid: string, num: number) => instance.post('/cart/add', {
  userid,
  proid,
  num
})

// 获取购物车列表
export const getCartsList = (userid: string) => instance.post('/cart/list', { userid })

// 删除一条数据
export const deleteItem = (cartid: string) => instance.post('/cart/remove', { cartid })

// 修改一条状态
export const changeSelectone = (cartid: string, flag: boolean) => instance.post('/cart/selectone', { cartid, flag })

// 修改全部状态
export const changeSelectall = (cartid: string, type: boolean) => instance.post('/cart/selectall', { cartid, type })
